
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Swiper demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
    <!-- Link Swiper's CSS -->
    <link rel="stylesheet" href="css/swiper.min.css">
    <link rel="stylesheet" href="css/animate.min.css">

    <!-- Demo styles -->
    <style>
        html, body {
            position: relative;
            height: 100%;
        }
        body {
            background: #eee;
            font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
            font-size: 14px;
            color:#000;
            margin: 0;
            padding: 0;
        }
        .swiper-container {
            width: 100%;
            height: 100%;
        }
        .swiper-slide {
            text-align: center;
            font-size: 18px;
            background: #fff;

            /* Center slide text vertically */
            display: -webkit-box;
            display: -ms-flexbox;
            display: -webkit-flex;
            display: flex;
            -webkit-box-pack: center;
            -ms-flex-pack: center;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-box-align: center;
            -ms-flex-align: center;
            -webkit-align-items: center;
            align-items: center;
        }
        /*自己的css*/

        /*背景*/
        .swiper-slide{
            background: url("节日img/bg.jpg");
        }
        .s1_header{
            position: absolute;
            top:0;
            left:50%;
            margin-left: -161px;
            animation-iteration-count:infinite;
            /*永久执行*/
        }
        .s1_top_img{
            width: 50%;
        }
        .s1_footer{
            position: absolute;
            bottom:0;
            background: #000;
            width: 100%;
            height: 20%;
            border-top-right-radius: 50%;
            border-top-left-radius: 50%;
            background:radial-gradient(#ff0,#932727);
        }
        .music{
            z-index: 999;
            position: absolute;
            right: 10px;
            top:10px;
            animation-name:music-xz;
            animation-duration:4s;
            animation-timing-function:linear;
            animation-delay:0.5s;
            animation-iteration-count:infinite;
            animation-play-state:running;
        }
        .pause {
            animation-play-state: paused;
        }
        /*按钮*/
        .swiper-button-next{
            position: absolute;
            top:auto;
            bottom:1%;
            left:50%;
            transform: rotate(-90deg);
            /*左上角转  27 的一半*/
            margin-left: -13.5px;
            animation-name:next-top;
            animation-duration:2s;
            animation-timing-function:linear;
            animation-delay:0.5s;
            animation-iteration-count:infinite;
            animation-play-state:running;
        }
        /*音乐动画*/
        @keyframes music-xz
        {
            0%   {
                transform:rotate(0deg);
            }
            50%  {
                transform:rotate(180deg);
            }
            100% {
                transform:rotate(360deg);
            }
        }
        /*按钮动画*/
        @keyframes next-top
        {
            0%   {
                transform:rotate(-90deg) translate(10px,0);
            }
            50%  {
                transform:rotate(-90deg) translate(20px,0);
            }
            100% {
                transform:rotate(-90deg) translate(10px,0);
            }
        }
    </style>
</head>
<body>
<!-- Swiper -->
<img src="节日img/music_off.png" alt="" class="music" id="music">
<audio src="李宗盛-爱的代价.mp3" autoplay="autoplay" id="love"></audio>
<div class="swiper-container">
    <div class="swiper-wrapper">
        <div class="swiper-slide">
            <div class="s1_header ani"
                 swiper-animate-effect="swing"
                 swiper-animate-duration="1s"
                 swiper-animate-delay="0.5s">
                <img src="节日img/lind.png" class="s1_top_img" alt="">
            </div>
            <div class="s1_main">
                <img src="节日img/word.png" alt="">
                <img src="节日img/oldMan.png" alt="">
            </div>
            <div class="s1_footer">
                <p>12月24日</p>
                <p>快来报名吧</p>
            </div>
        </div>
        <div class="swiper-slide">Slide 2</div>
        <div class="swiper-slide">Slide 3</div>
        <div class="swiper-slide">Slide 4</div>
        <div class="swiper-slide">Slide 5</div>
        <div class="swiper-slide">Slide 6</div>
        <div class="swiper-slide">Slide 7</div>
        <div class="swiper-slide">Slide 8</div>
        <div class="swiper-slide">Slide 9</div>
        <div class="swiper-slide">Slide 10</div>
    </div>
    <!-- Add Pagination -->
    <div class="swiper-pagination"></div>
    <!--buton-->
    <div class="swiper-button-next"></div>
</div>

<!-- Swiper JS -->
<script src="js/swiper.min.js"></script>
<script src="js/swiper.animate.min.js"></script>

<!-- Initialize Swiper -->
<script>
    var swiper = new Swiper('.swiper-container', {
        direction: 'vertical',
        pagination: {
            el: '.swiper-pagination',
            clickable: true
        },
        nevigation:{
            nextEl:"swiper-button-next"

        },
        on:{
            init: function(){
                swiperAnimateCache(this); //隐藏动画元素
                swiperAnimate(this); //初始化完成开始动画
            },
            slideChangeTransitionEnd: function(){
                swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
            }
        }
    });
//   动画旋转暂停和继续
    love=document.getElementById("love");
    music.onclick=function(){
        if (this.classList.contains('pause')) {
            this.classList.remove('pause');
        }else {
            this.classList.add('pause');
        }
        bf()
    };
//音乐暂停和播放
    function bf(){
        if(love.paused){
            love.play();//audio.play();// 这个就是播放
        }else{
            love.pause();// 这个就是暂停
        }
    }
</script>
</body>
</html>
